/****************************************************************************
 *
 *   Copyright (c) 2020-2021 PX4 Development Team. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 * 3. Neither the name PX4 nor the names of its contributors may be
 *    used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 *
 ****************************************************************************/

#include <stdint.h>

static constexpr float SAMPLING_RES = 10;
static constexpr float SAMPLING_MIN_LAT = -90;
static constexpr float SAMPLING_MAX_LAT = 90;
static constexpr float SAMPLING_MIN_LON = -180;
static constexpr float SAMPLING_MAX_LON = 180;

static constexpr int LAT_DIM = 19;
static constexpr int LON_DIM = 37;


// *INDENT-OFF*
// Magnetic declination data in radians * 10^-4
// Model: WMM-2020,
// Version: 0.5.1.11,
// Date: 2021.5425,
static constexpr const int16_t declination_table[19][37] {
	//    LONGITUDE:   -180,  -170,  -160,  -150,  -140,  -130,  -120,  -110,  -100,   -90,   -80,   -70,   -60,   -50,   -40,   -30,   -20,   -10,     0,    10,    20,    30,    40,    50,    60,    70,    80,    90,   100,   110,   120,   130,   140,   150,   160,   170,   180,
	/* LAT: -90 */ {  26012, 24267, 22521, 20776, 19031, 17285, 15540, 13795, 12049, 10304,  8559,  6813,  5068,  3323,  1578,  -168, -1913, -3658, -5403, -7149, -8894,-10639,-12385,-14130,-15875,-17621,-19366,-21111,-22857,-24602,-26348,-28093,-29838, 31248, 29503, 27757, 26012, },
	/* LAT: -80 */ {  22581, 20446, 18503, 16727, 15085, 13545, 12080, 10668,  9293,  7942,  6610,  5291,  3981,  2676,  1369,    51, -1289, -2659, -4067, -5517, -7009, -8544,-10119,-11736,-13399,-15115,-16899,-18769,-20750,-22866,-25138,-27572,-30141, 30049, 27427, 24916, 22581, },
	/* LAT: -70 */ {  14968, 13572, 12449, 11490, 10625,  9796,  8957,  8071,  7120,  6102,  5032,  3938,  2851,  1794,   771,  -240, -1275, -2378, -3574, -4869, -6244, -7670, -9115,-10555,-11980,-13394,-14821,-16303,-17921,-19825,-22329,-26103, 30811, 24187, 19628, 16841, 14968, },
	/* LAT: -60 */ {   8385,  8147,  7873,  7605,  7357,  7109,  6806,  6377,  5766,  4949,  3950,  2839,  1716,   683,  -205,  -967, -1697, -2515, -3510, -4697, -6019, -7383, -8701, -9911,-10977,-11878,-12596,-13092,-13264,-12814,-10725, -3589,  4792,  7581,  8373,  8511,  8385, },
	/* LAT: -50 */ {   5457,  5497,  5446,  5362,  5293,  5261,  5230,  5107,  4768,  4111,  3105,  1835,   492,  -697, -1580, -2156, -2559, -2996, -3668, -4663, -5892, -7161, -8302, -9208, -9813,-10062, -9878, -9131, -7631, -5276, -2376,   370,  2478,  3902,  4776,  5251,  5457, },
	/* LAT: -40 */ {   3934,  4028,  4040,  4001,  3946,  3915,  3924,  3916,  3747,  3219,  2205,   769,  -797, -2123, -3002, -3468, -3663, -3729, -3888, -4431, -5383, -6450, -7339, -7888, -8009, -7646, -6770, -5392, -3677, -1969,  -505,   718,  1760,  2621,  3275,  3703,  3934, },
	/* LAT: -30 */ {   2966,  3053,  3088,  3080,  3026,  2952,  2895,  2864,  2740,  2269,  1246,  -264, -1874, -3140, -3897, -4256, -4350, -4155, -3725, -3477, -3807, -4541, -5245, -5609, -5500, -4927, -3976, -2768, -1550,  -597,    85,   686,  1307,  1905,  2410,  2769,  2966, },
	/* LAT: -20 */ {   2324,  2371,  2394,  2403,  2366,  2276,  2173,  2099,  1955,  1466,   423, -1056, -2538, -3614, -4166, -4298, -4110, -3568, -2713, -1899, -1594, -1929, -2577, -3056, -3106, -2758, -2127, -1308,  -523,   -26,   241,   545,   982,  1454,  1871,  2174,  2324, },
	/* LAT: -10 */ {   1930,  1926,  1910,  1914,  1892,  1812,  1708,  1620,  1437,   893,  -158, -1529, -2809, -3655, -3943, -3734, -3171, -2396, -1549,  -786,  -306,  -322,  -782, -1291, -1514, -1431, -1120,  -619,  -115,   133,   187,   349,   716,  1146,  1532,  1814,  1930, },
	/* LAT:   0 */ {   1718,  1686,  1636,  1633,  1628,  1564,  1467,  1358,  1106,   489,  -544, -1770, -2833, -3437, -3457, -2973, -2212, -1428,  -771,  -230,   189,   312,    43,  -373,  -634,  -693,  -595,  -331,   -36,    59,     4,    95,   432,   866,  1278,  1592,  1718, },
	/* LAT:  10 */ {   1584,  1594,  1556,  1578,  1609,  1566,  1451,  1270,   897,   181,  -837, -1916, -2753, -3110, -2924, -2329, -1555,  -839,  -318,    67,   395,   550,   397,    76,  -163,  -271,  -292,  -208,  -100,  -137,  -271,  -242,    55,   502,   976,  1378,  1584, },
	/* LAT:  20 */ {   1406,  1556,  1620,  1716,  1806,  1791,  1643,  1346,   804,   -52, -1096, -2054, -2663, -2788, -2473, -1878, -1168,  -515,   -48,   265,   526,   677,   592,   349,   148,    30,   -57,  -117,  -193,  -379,  -612,  -670,  -440,     1,   537,  1051,  1406, },
	/* LAT:  30 */ {   1114,  1481,  1743,  1968,  2130,  2144,  1962,  1544,   818,  -212, -1334, -2222, -2650, -2600, -2209, -1633,  -979,  -358,   110,   420,   654,   804,   789,   641,   490,   367,   215,    10,  -267,  -638, -1006, -1167, -1011,  -590,   -16,   592,  1114, },
	/* LAT:  40 */ {    766,  1353,  1847,  2240,  2489,  2534,  2321,  1791,   880,  -351, -1599, -2479, -2812, -2669, -2227, -1636,  -983,  -351,   163,   532,   806,  1009,  1108,  1099,  1023,   876,   614,   212,  -320,  -924, -1447, -1695, -1583, -1169,  -570,   104,   766, },
	/* LAT:  50 */ {    487,  1236,  1916,  2471,  2836,  2942,  2712,  2058,   913,  -594, -2031, -2959, -3263, -3076, -2587, -1942, -1231,  -531,    89,   599,  1021,  1381,  1666,  1841,  1863,  1680,  1244,   547,  -340, -1242, -1926, -2219, -2099, -1658, -1019,  -282,   487, },
	/* LAT:  60 */ {    307,  1163,  1969,  2661,  3162,  3370,  3151,  2332,   803, -1178, -2915, -3905, -4161, -3900, -3326, -2578, -1749,  -905,   -93,   662,  1358,  1993,  2540,  2942,  3108,  2932,  2307,  1206,  -200, -1523, -2402, -2720, -2557, -2059, -1359,  -549,   307, },
	/* LAT:  70 */ {    103,  1044,  1943,  2741,  3352,  3639,  3373,  2210,   -83, -2849, -4817, -5636, -5633, -5139, -4360, -3418, -2388, -1316,  -237,   827,  1856,  2826,  3698,  4411,  4867,  4912,  4322,  2876,   703, -1405, -2714, -3165, -3006, -2469, -1711,  -832,   103, },
	/* LAT:  80 */ {   -502,   425,  1282,  1976,  2358,  2153,   879, -1903, -5264, -7393, -8098, -7925, -7265, -6325, -5217, -4005, -2729, -1416,   -85,  1248,  2565,  3850,  5079,  6219,  7215,  7977,  8325,  7901,  6046,  2410, -1125, -2863, -3255, -2943, -2274, -1426,  -502, },
	/* LAT:  90 */ { -30216,-28470,-26725,-24979,-23234,-21489,-19743,-17998,-16253,-14507,-12762,-11017, -9272, -7526, -5781, -4036, -2291,  -546,  1199,  2945,  4690,  6435,  8180,  9926, 11671, 13416, 15162, 16907, 18652, 20398, 22143, 23889, 25634, 27380, 29125, 30871,-30216, },
};

// Magnetic inclination data in radians * 10^-4
// Model: WMM-2020,
// Version: 0.5.1.11,
// Date: 2021.5425,
static constexpr const int16_t inclination_table[19][37] {
	//    LONGITUDE:   -180,  -170,  -160,  -150,  -140,  -130,  -120,  -110,  -100,   -90,   -80,   -70,   -60,   -50,   -40,   -30,   -20,   -10,     0,    10,    20,    30,    40,    50,    60,    70,    80,    90,   100,   110,   120,   130,   140,   150,   160,   170,   180,
	/* LAT: -90 */ { -12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578,-12578, },
	/* LAT: -80 */ { -13664,-13531,-13370,-13190,-12996,-12794,-12589,-12389,-12197,-12021,-11863,-11729,-11618,-11532,-11469,-11427,-11408,-11411,-11438,-11492,-11575,-11689,-11834,-12007,-12204,-12421,-12650,-12883,-13111,-13324,-13511,-13662,-13766,-13818,-13816,-13762,-13664, },
	/* LAT: -70 */ { -14114,-13796,-13476,-13153,-12821,-12476,-12120,-11762,-11418,-11108,-10854,-10669,-10556,-10503,-10489,-10494,-10503,-10514,-10538,-10595,-10702,-10875,-11120,-11433,-11804,-12220,-12668,-13131,-13597,-14050,-14469,-14816,-15008,-14957,-14727,-14430,-14114, },
	/* LAT: -60 */ { -13523,-13171,-12833,-12501,-12157,-11785,-11369,-10914,-10445,-10012, -9679, -9500, -9494, -9629, -9834,-10029,-10160,-10209,-10200,-10187,-10233,-10389,-10674,-11078,-11573,-12127,-12713,-13308,-13897,-14458,-14955,-15246,-15075,-14693,-14288,-13896,-13523, },
	/* LAT: -50 */ { -12498,-12157,-11827,-11506,-11183,-10836,-10436, -9964, -9433, -8909, -8514, -8382, -8575, -9032, -9597,-10114,-10482,-10654,-10634,-10487,-10345,-10345,-10558,-10967,-11504,-12095,-12682,-13222,-13670,-13970,-14079,-14006,-13804,-13521,-13193,-12846,-12498, },
	/* LAT: -40 */ { -11240,-10894,-10549,-10204, -9865, -9526, -9164, -8737, -8215, -7647, -7214, -7161, -7609, -8427, -9349,-10184,-10851,-11296,-11450,-11296,-10959,-10682,-10664,-10935,-11392,-11896,-12345,-12671,-12833,-12839,-12749,-12611,-12430,-12198,-11912,-11585,-11240, },
	/* LAT: -30 */ {  -9601, -9227, -8851, -8462, -8069, -7692, -7334, -6940, -6426, -5813, -5353, -5418, -6170, -7363, -8616, -9717,-10639,-11359,-11774,-11782,-11422,-10915,-10572,-10562,-10808,-11129,-11389,-11508,-11448,-11273,-11096,-10958,-10810,-10601,-10320, -9976, -9601, },
	/* LAT: -20 */ {  -7369, -6936, -6525, -6099, -5654, -5223, -4829, -4411, -3842, -3154, -2695, -2933, -4020, -5622, -7253, -8633, -9711,-10499,-10953,-11003,-10653,-10045, -9483, -9231, -9274, -9435, -9579, -9601, -9432, -9159, -8961, -8869, -8759, -8549, -8232, -7823, -7369, },
	/* LAT: -10 */ {  -4412, -3887, -3441, -3007, -2550, -2099, -1681, -1220,  -587,   122,   497,    94, -1210, -3114, -5094, -6719, -7834, -8483, -8761, -8710, -8313, -7638, -6973, -6621, -6577, -6670, -6789, -6816, -6631, -6333, -6174, -6174, -6125, -5904, -5521, -4997, -4412, },
	/* LAT:   0 */ {   -903,  -292,   165,   563,   980,  1398,  1792,  2244,  2837,  3423,  3638,  3163,  1890,    -6, -2053, -3722, -4752, -5198, -5267, -5105, -4676, -3970, -3265, -2888, -2825, -2896, -3024, -3099, -2970, -2733, -2672, -2804, -2855, -2663, -2239, -1614,  -903, },
	/* LAT:  10 */ {   2565,  3180,  3606,  3943,  4297,  4665,  5020,  5416,  5876,  6255,  6301,  5828,  4762,  3209,  1517,   127,  -697,  -960,  -878,  -648,  -245,   386,  1018,  1359,  1421,  1373,  1270,  1179,  1222,  1328,  1259,  1004,   824,   902,  1253,  1850,  2565, },
	/* LAT:  20 */ {   5418,  5939,  6313,  6605,  6918,  7262,  7608,  7962,  8303,  8510,  8430,  7978,  7153,  6063,  4936,  4019,  3477,  3347,  3489,  3728,  4054,  4514,  4973,  5230,  5284,  5263,  5212,  5156,  5146,  5131,  4963,  4639,  4350,  4265,  4436,  4855,  5418, },
	/* LAT:  30 */ {   7569,  7938,  8253,  8534,  8843,  9191,  9552,  9897, 10179, 10299, 10160,  9744,  9120,  8411,  7748,  7231,  6933,  6883,  7020,  7228,  7471,  7768,  8055,  8229,  8284,  8294,  8294,  8285,  8265,  8186,  7968,  7621,  7271,  7053,  7036,  7229,  7569, },
	/* LAT:  40 */ {   9266,  9485,  9741, 10026, 10353, 10715, 11085, 11427, 11683, 11770, 11624, 11267, 10795, 10320,  9922,  9636,  9482,  9474,  9580,  9739,  9911, 10094, 10265, 10389, 10466, 10524, 10577, 10610, 10596, 10489, 10251,  9904,  9539,  9256,  9112,  9124,  9266, },
	/* LAT:  50 */ {  10801, 10923, 11125, 11395, 11719, 12075, 12432, 12750, 12975, 13037, 12899, 12602, 12237, 11890, 11613, 11424, 11328, 11321, 11384, 11485, 11597, 11711, 11827, 11942, 12059, 12180, 12292, 12365, 12358, 12237, 11993, 11667, 11329, 11044, 10854, 10774, 10801, },
	/* LAT:  60 */ {  12318, 12393, 12545, 12765, 13036, 13338, 13642, 13910, 14087, 14115, 13979, 13729, 13439, 13166, 12944, 12786, 12693, 12660, 12674, 12720, 12786, 12870, 12975, 13106, 13264, 13439, 13603, 13713, 13722, 13605, 13382, 13104, 12825, 12587, 12417, 12326, 12318, },
	/* LAT:  70 */ {  13759, 13803, 13900, 14044, 14226, 14431, 14641, 14823, 14927, 14906, 14766, 14562, 14343, 14138, 13964, 13828, 13733, 13677, 13657, 13669, 13710, 13781, 13883, 14018, 14184, 14370, 14555, 14696, 14745, 14675, 14515, 14317, 14122, 13957, 13837, 13770, 13759, },
	/* LAT:  80 */ {  15001, 15015, 15055, 15116, 15194, 15281, 15361, 15406, 15384, 15301, 15186, 15060, 14936, 14822, 14721, 14639, 14577, 14535, 14516, 14520, 14546, 14594, 14665, 14757, 14869, 14995, 15129, 15261, 15368, 15414, 15378, 15294, 15200, 15116, 15053, 15014, 15001, },
	/* LAT:  90 */ {  15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, 15392, },
};

// Magnetic strength data in milli-Gauss * 10
// Model: WMM-2020,
// Version: 0.5.1.11,
// Date: 2021.5425,
static constexpr const int16_t strength_table[19][37] {
	//    LONGITUDE:  -180, -170, -160, -150, -140, -130, -120, -110, -100,  -90,  -80,  -70,  -60,  -50,  -40,  -30,  -20,  -10,    0,   10,   20,   30,   40,   50,   60,   70,   80,   90,  100,  110,  120,  130,  140,  150,  160,  170,  180,
	/* LAT: -90 */ {  5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, 5457, },
	/* LAT: -80 */ {  6064, 6001, 5922, 5831, 5728, 5617, 5499, 5378, 5255, 5135, 5021, 4916, 4822, 4742, 4678, 4633, 4608, 4606, 4627, 4672, 4742, 4836, 4950, 5081, 5224, 5374, 5523, 5667, 5798, 5911, 6004, 6074, 6118, 6138, 6135, 6109, 6064, },
	/* LAT: -70 */ {  6308, 6176, 6027, 5863, 5685, 5493, 5288, 5074, 4854, 4639, 4436, 4253, 4095, 3963, 3859, 3782, 3734, 3721, 3749, 3824, 3951, 4130, 4357, 4624, 4918, 5225, 5529, 5812, 6062, 6267, 6419, 6515, 6557, 6550, 6502, 6419, 6308, },
	/* LAT: -60 */ {  6193, 6002, 5802, 5594, 5376, 5142, 4886, 4608, 4315, 4025, 3757, 3529, 3348, 3213, 3114, 3040, 2990, 2970, 2995, 3084, 3250, 3500, 3825, 4209, 4631, 5064, 5485, 5870, 6195, 6445, 6609, 6689, 6692, 6630, 6517, 6368, 6193, },
	/* LAT: -50 */ {  5849, 5620, 5389, 5160, 4928, 4684, 4414, 4111, 3782, 3450, 3147, 2906, 2743, 2651, 2602, 2568, 2536, 2510, 2515, 2585, 2756, 3043, 3435, 3904, 4410, 4916, 5392, 5812, 6152, 6394, 6534, 6576, 6534, 6425, 6264, 6067, 5849, },
	/* LAT: -40 */ {  5397, 5152, 4908, 4670, 4436, 4199, 3945, 3662, 3348, 3021, 2722, 2498, 2379, 2352, 2371, 2394, 2400, 2390, 2378, 2406, 2532, 2802, 3214, 3726, 4272, 4797, 5265, 5655, 5949, 6137, 6226, 6230, 6162, 6032, 5852, 5634, 5397, },
	/* LAT: -30 */ {  4881, 4641, 4403, 4170, 3944, 3726, 3507, 3276, 3021, 2746, 2487, 2303, 2231, 2254, 2321, 2393, 2460, 2512, 2536, 2549, 2613, 2806, 3161, 3645, 4176, 4674, 5096, 5415, 5620, 5720, 5747, 5721, 5642, 5511, 5332, 5116, 4881, },
	/* LAT: -20 */ {  4322, 4111, 3904, 3700, 3504, 3321, 3153, 2990, 2813, 2616, 2425, 2290, 2246, 2286, 2375, 2485, 2614, 2744, 2836, 2875, 2898, 2989, 3223, 3602, 4050, 4478, 4829, 5067, 5175, 5183, 5153, 5106, 5024, 4897, 4731, 4534, 4322, },
	/* LAT: -10 */ {  3791, 3631, 3480, 3334, 3198, 3078, 2976, 2884, 2789, 2675, 2554, 2453, 2404, 2425, 2509, 2637, 2793, 2953, 3080, 3145, 3160, 3184, 3303, 3550, 3874, 4196, 4462, 4628, 4666, 4614, 4547, 4482, 4393, 4269, 4120, 3957, 3791, },
	/* LAT:   0 */ {  3412, 3321, 3238, 3165, 3110, 3072, 3047, 3030, 3007, 2961, 2882, 2787, 2704, 2670, 2708, 2808, 2941, 3077, 3194, 3271, 3303, 3324, 3396, 3550, 3757, 3970, 4150, 4259, 4267, 4200, 4112, 4019, 3907, 3776, 3642, 3519, 3412, },
	/* LAT:  10 */ {  3283, 3253, 3233, 3230, 3256, 3304, 3360, 3416, 3452, 3444, 3375, 3260, 3132, 3034, 3004, 3043, 3122, 3221, 3321, 3407, 3471, 3533, 3619, 3736, 3869, 4006, 4126, 4198, 4201, 4141, 4032, 3889, 3728, 3569, 3434, 3338, 3283, },
	/* LAT:  20 */ {  3400, 3404, 3431, 3487, 3580, 3702, 3832, 3951, 4033, 4046, 3973, 3831, 3662, 3520, 3441, 3426, 3459, 3530, 3626, 3723, 3813, 3911, 4021, 4132, 4239, 4349, 4451, 4517, 4529, 4472, 4337, 4136, 3909, 3700, 3538, 3438, 3400, },
	/* LAT:  30 */ {  3723, 3732, 3788, 3889, 4034, 4206, 4383, 4540, 4649, 4676, 4604, 4448, 4257, 4089, 3981, 3932, 3934, 3983, 4068, 4165, 4262, 4367, 4482, 4600, 4719, 4844, 4964, 5050, 5078, 5023, 4868, 4629, 4356, 4102, 3903, 3776, 3723, },
	/* LAT:  40 */ {  4223, 4223, 4291, 4416, 4585, 4773, 4958, 5115, 5220, 5246, 5177, 5027, 4838, 4662, 4531, 4453, 4425, 4445, 4504, 4582, 4667, 4764, 4878, 5011, 5162, 5323, 5474, 5584, 5625, 5573, 5419, 5182, 4908, 4649, 4438, 4294, 4223, },
	/* LAT:  50 */ {  4831, 4827, 4886, 4998, 5146, 5307, 5457, 5577, 5651, 5659, 5595, 5466, 5302, 5136, 4997, 4898, 4842, 4828, 4851, 4900, 4969, 5059, 5177, 5327, 5502, 5686, 5852, 5972, 6018, 5976, 5846, 5650, 5424, 5208, 5028, 4900, 4831, },
	/* LAT:  60 */ {  5392, 5383, 5414, 5479, 5566, 5661, 5747, 5813, 5845, 5835, 5779, 5684, 5562, 5432, 5312, 5215, 5147, 5112, 5109, 5136, 5191, 5277, 5394, 5541, 5707, 5876, 6024, 6130, 6175, 6154, 6072, 5945, 5798, 5655, 5532, 5443, 5392, },
	/* LAT:  70 */ {  5726, 5708, 5707, 5721, 5744, 5771, 5794, 5808, 5806, 5786, 5745, 5687, 5615, 5538, 5464, 5399, 5350, 5322, 5316, 5336, 5380, 5449, 5540, 5649, 5766, 5881, 5981, 6054, 6094, 6098, 6069, 6016, 5948, 5878, 5813, 5761, 5726, },
	/* LAT:  80 */ {  5789, 5772, 5758, 5747, 5737, 5728, 5718, 5706, 5691, 5672, 5649, 5623, 5595, 5568, 5542, 5522, 5507, 5502, 5506, 5521, 5547, 5582, 5624, 5672, 5722, 5770, 5813, 5848, 5872, 5886, 5888, 5881, 5868, 5849, 5828, 5808, 5789, },
	/* LAT:  90 */ {  5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, 5679, },
};
